package com.itlong.cloud.equip.property;

import com.itlong.cloud.POJO.DTO.app.AppFaceRecognitionDeviceAuthDTO;
import com.itlong.cloud.POJO.DTO.common.PadFaceSyncDataDTO;
import com.itlong.cloud.POJO.VO.app.PadIncrementUpdateGetVO;
import com.itlong.cloud.POJO.VO.property.PadFaceUserInfoNewVO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardIncrementUpdateGetVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      平板人脸增量同步数据暴露接口
 * </desc>
 *
 * @createDate 2019/01/17
 */
@FeignClient(name = "equip-service")
public interface IPadFaceSyncDataServiceClient {

    /**
     * <desc>
     *      住户信息变更和楼层映射信息变更触发平板人脸识别离线优先同步数据
     * </desc>
     *
     * @param padFaceSyncDataDTO 平板人脸增量同步数据DTO
     * @return 0失败，1成功
     * @author wangzhi
     * @createDate 2019/01/17
     */
    @PostMapping("property/padPullCloudInfo/userOrFloorSync")
    Integer userOrFloorSync(@RequestBody PadFaceSyncDataDTO padFaceSyncDataDTO) throws Exception;

    /**
     * <desc>
     *      住户信息变更和楼层映射信息变更触发一卡通动态人脸识别同步数据
     * </desc>
     *
     * @param padFaceSyncDataDTO 人脸增量同步数据DTO
     * @return 0失败，1成功
     * @author wangzhi
     * @createDate 2019/03/19
     */
    @PostMapping("property/padPullCloudInfo/userOrFloorSyncSmartCard")
    Integer userOrFloorSyncSmartCard(@RequestBody PadFaceSyncDataDTO padFaceSyncDataDTO) throws Exception;

    /**
     * <desc>
     *      平板增量获取变更数据接口
     * </desc>
     *
     * @param padDeviceUnique 平板deviceUnique
     * @return 变更数据
     * @author wangzhi
     * @createDate 2019/01/18
     */
    @PostMapping("property/padPullCloudInfo/getIncrementUpdate")
    List<PadIncrementUpdateGetVO> getIncrementUpdate(@RequestParam("padDeviceUnique") String padDeviceUnique) throws Exception;

    /**
     * <desc>
     *      修改同步状态为同步结束
     * </desc>
     *
     * @param syncSerialNo 同步流水号，多个用英文逗号相连
     * @return 0失败，1成功
     * @author wangzhi
     * @createDate 2019/01/18
     */
    @PostMapping("property/padPullCloudInfo/updateSyncStatus")
    Integer updateSyncStatus(@RequestParam("syncSerialNo") String syncSerialNo) throws Exception;

    /**
     * <desc>
     *      修改同步状态为同步结束
     * </desc>
     *
     * @param syncSerialNo 同步流水号，多个用英文逗号相连
     * @param msg 失败原因
     * @return 0失败，1成功
     * @author wangzhi
     * @createDate 2019/01/18
     */
    @PostMapping("property/padPullCloudInfo/reportUpdateResult")
    Integer reportUpdateResult(@RequestParam("syncSerialNo") String syncSerialNo,@RequestParam("msg") String msg) throws Exception;

    /**
     * <desc>
     *      平板上电获取全量数据
     * </desc>
     *
     * @param deviceUnique
     * @param type
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/23
     */
    @PostMapping("property/padPullCloudInfo/pullFull")
    Map<String,Object> pullFull(@RequestParam("bandDeviceUnique") String bandDeviceUnique,
                                @RequestParam("deviceUnique") String deviceUnique,
                                @RequestParam("type") Integer type);

    /**
     * <desc>
     *      增量获取变更数据
     * </desc>
     *
     * @param projectId 项目编号
     * @return 增量数据
     * @author wangzhi
     * @createDate 2019/03/18
     */
    @PostMapping("property/padPullCloudInfo/getIncrementUpdateSmartCard")
    List<SmartCardIncrementUpdateGetVO> getIncrementUpdateSmartCard(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      修改同步状态为同步结束
     * </desc>
     *
     * @param syncSerialNo 同步流水号，多个用英文逗号相连
     * @return 0-失败 1-成功
     * @author wangzhi
     * @createDate 2019/03/18
     */
    @PostMapping("property/padPullCloudInfo/updateSyncStatusSmartCard")
    Integer updateSyncStatusSmartCard(@RequestParam("syncSerialNo") String syncSerialNo) throws Exception;

    /**
     * <desc>
     *      根据单元楼层获取电梯权限
     * </desc>
     *
     * @param unitId
     * @param floorNum
     * @return
     * @author Jiaqi.X
     * @createDate 2019/06/06
     */
    @PostMapping("property/padPullCloudInfo/getElevatorsByUnitId")
    List<Map<String,Object>> getElevatorsByUnitId(@RequestParam("unitId") String unitId,@RequestParam("floorNum") String floorNum);

    /**
     * <desc>
     *      生成人脸指令
     * </desc>
     *
     * @param deviceUnique  人脸识别仪编号
     * @param userInfo   用户信息
     * @return
     * @author Qiang.S
     * @createDate 2019/12/24
     */
    @PostMapping("property/padPullCloudInfo/createUserInstruct")
    void createUserInstruct(@RequestParam("deviceUnique") String deviceUnique,
                            @RequestParam("userInfo") String userInfo,
                            @RequestParam(value = "InstructionType",required = false) Integer InstructionType,
                            @RequestParam(value = "sourceSystem" ,required = false) Integer sourceSystem);

    /**
     * <desc>
     *      处理绑定普通门禁设备平板指令
     * </desc>
     *
     * @param appFaceRecognitionDeviceAuthDTO  处理绑定普通门禁平板指令入参
     * @return
     * @author Qiang.S
     * @createDate 2020/03/09
     */
    @PostMapping("property/padPullCloudInfo/padDeviceAuth")
    void padDeviceAuth(@RequestBody AppFaceRecognitionDeviceAuthDTO appFaceRecognitionDeviceAuthDTO) throws Exception;

    /**
     * <desc>
     *      处理绑定普通门禁用户平板指令
     * </desc>
     *
     * @param appFaceRecognitionDeviceAuthDTO  处理绑定普通门禁平板指令入参
     * @return
     * @author Qiang.S
     * @createDate 2020/03/10
     */
    @PostMapping("property/padPullCloudInfo/padUserAuth")
    void padUserAuth(@RequestBody AppFaceRecognitionDeviceAuthDTO appFaceRecognitionDeviceAuthDTO) throws Exception;

    /**
     * <desc>
     *      处理启用禁用角色平板指令
     * </desc>
     *
     * @param appFaceRecognitionDeviceAuthDTO  处理启用禁用角色平板指令入参
     * @return
     * @author Qiang.S
     * @createDate 2020/04/01
     */
    @PostMapping("property/padPullCloudInfo/padRoleStatusBussiness")
    void padRoleStatusBussiness(@RequestBody AppFaceRecognitionDeviceAuthDTO appFaceRecognitionDeviceAuthDTO) throws Exception;

    /**
     * <desc>
     *      查询用户是否有人脸
     * </desc>
     *
     * @param userId 用户编号
     * @param projectId 项目编号
     * @return
     * @author Juguang.S
     * @createDate 2020/05/20
     */
    @PostMapping("property/padPullCloudInfo/getFacePicUrl")
    String getFacePicUrl(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      sdk注销用户时处理平板用户指令
     * </desc>
     *
     * @param userId 用户编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/03
     */
    @PostMapping("property/padPullCloudInfo/userSyncForSDK")
    void userSyncForSDK(@RequestParam("userId") String userId);

    /**
     * <desc>
     *      无地址平板上电获取全量数据
     * </desc>
     *
     * @param bandDeviceUnique 绑定设备类表
     * @param deviceUnique 平板设备唯一码
     * @param type 设备类型
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/23
     */
    @PostMapping("property/padPullCloudInfo/pullFullNoAddress")
    Map<String,Object> pullFullNoAddress(@RequestParam("bandDeviceUnique") String bandDeviceUnique,
                                         @RequestParam("deviceUnique") String deviceUnique,
                                         @RequestParam("type") Integer type) throws Exception;


    /**
     * <desc>
     *      京东住户信息变更及住户权限变更触发平板人脸识别离线优先同步数据
     * </desc>
     *
     * @param padFaceSyncDataDTO 平板人脸增量同步数据DTO
     * @return 0失败，1成功
     * @author Zhu.yj
     * @createDate 2020/12/9
     */
    @PostMapping("/operate/padPullCloudInfo/jdUserDataSync")
    Integer jdUserDataSync(@RequestBody PadFaceSyncDataDTO padFaceSyncDataDTO) throws Exception;

    /**
     * <desc>
     *      京东 sdk注销用户时处理平板用户指令
     * </desc>
     *
     * @param userId 用户编号
     * @return
     * @Author Zhu.yj
     * @createDate  2020/12/18
     */
    @PostMapping("/sdk/jd/jdUserSyncForSDK")
    void jdUserSyncForSDK(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      注销用户时处理平板用户指令
     * </desc>
     *
     * @param userId 用户编号
     * @return
     * @Author Juguang.S
     * @createDate  2021/05/21
     */
    @PostMapping("/sdk/jd/userSyncForFaceUrl")
    void userSyncForFaceUrl(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      异步修改人脸照片,京东设置超时时间为5s，
     * </desc>
     *
     * @param padFaceSyncDataDTO
     * @return
     * @Author Zhu.yj
     * @createDate  2021/1/27
     */
    @PostMapping("sdk/jd/jdUpdatePhotoSync")
    void jdUpdatePhotoSync(@RequestBody PadFaceSyncDataDTO padFaceSyncDataDTO);
}
